Skip to main content

Starting Playback

Copy Required

Always copy this script to your project with a new name. Using the plugin's original script on the Reactional Maanger directly will cause issues during plugin updates.

Quick Start​

Enable Autoplay on the BasicPlayback component to start music immediately.

How It Works​

Review your options for playback in the script below.

  • Initialize Audio — Reactional.Setup.InitAudio() syncs sample rates (required)
  • Enable Output — Reactional.Playback.MusicSystem.PlaybackAllowed = true enables audio output
BasicPlayback
using UnityEngine;
using System.Threading.Tasks;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace Reactional.Core
{
[DefaultExecutionOrder(5000)]
public class BasicPlayback : MonoBehaviour
{
public enum UnloadOptions{UnloadTrack, UnloadTheme, UnloadAll}
// ... (click to expand)